package Year2021.Month11.Day1Homework;

import java.util.InputMismatchException;
import java.util.Scanner;

public class ClassHour {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入总课时");
        try {
            int a = in.nextInt();
            if (a < 100) {
                System.out.println("课时太少了");
                return;
            } else {
                System.out.println("请输入课程数");
                int b = in.nextInt();
                int c = a / b;          //c为平均课时；
                System.out.println("平均课时为"+c);
            }

        } catch (InputMismatchException e) {
            System.out.println("输入错误" + e);
        } catch (ArithmeticException e) {
            System.out.println("除法错误" + e);
        } catch (Exception e) {
            System.out.println("其他异常" + e);
        }finally {
            System.out.println("感谢使用!");

        }

    }
}
